package com.tuteng.administrator.ashospital.AdapterManger;

import android.content.Context;

import com.tuteng.administrator.ashospital.R;
import com.tuteng.administrator.ashospital.beans.Lis_jysqList;
import com.tuteng.administrator.ashospital.beans.Lis_mxBean;

import java.util.List;

/**
 * Created by Administrator on 2016/3/25.
 */
public class LismxAdapter extends CommonAdapter<Lis_mxBean>{
public LismxAdapter(Context context, List<Lis_mxBean> datas){
    super(context,datas, R.layout.list_lisitem);
}
 @Override
    public void convert(ViewHolder holder,Lis_mxBean friendBean) {
     holder.setText(R.id.tv_lis_xmmc,friendBean.getItemName());
     holder.setText(R.id.tv_lis_jyjg,friendBean.getResult());
     holder.setText(R.id.tv_lis_xmjc,friendBean.getItemCode());
     if(friendBean.getHighLowFlag().trim().equals("不显示"))
     { holder.setText(R.id.lis_item_zt,"");
         holder.setText(R.id.tv_lis_xmdw,"");
         holder.setText(R.id.tv_lis_ckfw,"");
        // holder.setText(R.id.lis_item_jg,friendBean.getResult());
     }
     else if(friendBean.getHighLowFlag().trim().equals("偏高"))
     {
         holder.setText(R.id.lis_item_zt,friendBean.getHighLowFlag());
         holder.setTextColor(R.id.lis_item_zt,R.color.red);
         holder.setText(R.id.tv_lis_xmdw,friendBean.getItemUnit());
         holder.setText(R.id.tv_lis_ckfw,friendBean.getReference());
     }
     else if(friendBean.getHighLowFlag().equals("偏低"))
     {    holder.setText(R.id.lis_item_zt,friendBean.getHighLowFlag());
         holder.setTextColor(R.id.lis_item_zt,R.color.blue);
         holder.setText(R.id.tv_lis_xmdw,friendBean.getItemUnit());
         holder.setText(R.id.tv_lis_ckfw,friendBean.getReference());
     }
     else
         {  holder.setText(R.id.lis_item_zt,friendBean.getHighLowFlag());
         holder.setText(R.id.tv_lis_xmdw,friendBean.getItemUnit());
         holder.setText(R.id.tv_lis_ckfw,friendBean.getReference());
     }

    }
}
